<?php
	require("includes/basic.php");
	if(!isset($_SESSION['uid']) && $userType!='A')
	{
		header("location:authorise.php");
	}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
	<HEAD>
		
		<TITLE> :: <?php echo $appName?> :: </TITLE>
		<link rel='stylesheet' type='text/css' href='style/inner.css'>
		<link rel='stylesheet' type='text/css' href='style/admin.css'>
		<script type='text/javascript' src='js/inner.js'></script>
	</HEAD>

	<body unselectable="on" class="dialog"> 
		<?php $pageName="Administration View"; ?>
		<?php require("includes/header.php"); ?>

				        
<?php	

$opencid=$_REQUEST['open'];
//echo $opencid;


$custdetails=mysql_query("SELECT * FROM customer_master WHERE customer_id=$opencid");

while($row=mysql_fetch_array($custdetails))
{

//extract($row);
$custid=$row['customer_id'];
$custname=$row['customer'];
$cust_desc=$row['cust_desc'];
$uname=$row['user_name'];

$usertypeid=$row['usertypeid'];

$pass=base64_decode($row['password']);
$record=$row['record_status'];
//$name=$row['customer_name'];
//$mob=$row['mobile'];
//$add=$row['address'];
?>
<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td id='screenH'>
		<div class='pathbar'><a href='index.php'>Admin</a> -> <a href="view-customers.php">Customers</a> -> Customer details</div>
		<div class='screenTitle'>
			<table width='100%' cellspacing='0'>
				<tr>
					<td>
						<?php echo "Customer Details";?>
					</td>		
				</tr>
			</table>
		</div>
</table>

	<center>
	<table>
<tr><td style="height:10px;">&nbsp;</td></tr>
</table>
	<table border="0" width="90%" style="border:1px solid #E0DFE3;" cellspacing="0">
	
<tr><td colspan="5" align="left" style="border-bottom:1px solid #E0DFE3;padding:5px;font-weight:bold;font-size:13px;background-color:#E0DFE3;"><b>CUSTOMER DETAILS</b></td></tr>


<tr>
<td colspan="2" style="border-bottom:1px solid #E0DFE3;height:60px;padding-left:10px;text-align:left;">

<?php

	//echo "select * from customer_logo where customer_id='$usertypeid'";
$sql = mysql_query("select * from customer_logo where customer_id='$usertypeid'");


if(mysql_num_rows($sql)>0)
{
	
	echo "<img src='getlogo.php?cuid=$usertypeid'>";
}
else
{
   echo "No logo added";
}
	?>

</td>
</tr>

<tr>
	<td class="open" style="text-align:left;">Customer</td>
    <td class="open_data"><?php echo $custname; ?></td>
</tr>
<tr>
	<td class="open" style="text-align:left;">Customer Description</td>
    <td class="open_data"><?php echo $cust_desc; ?></td>
</tr>

<tr>
	<td class="open" style="text-align:left;">User Name</td>
    <td class="open_data"><?php echo $uname; ?></td>
</tr>

<!-- <tr>
	<td class="open" style="text-align:left;">Password</td>
    <td class="open_data"><?php echo $pass; ?></td>
</tr> -->
<!-- <tr>
	<td class="open">Record Status</td>
    <td class="open_data"><?php echo $record; ?></td>
</tr> -->
<?php 

$pro=mysql_query("SELECT * FROM project_master WHERE project_created_by='$usertypeid'");

$pro_ro=mysql_num_rows($pro);



?>
<tr>
	<td class="open" style="text-align:left;">No. of Projects</td>
    <td class="open_data"><?php echo $pro_ro; ?></td>
</tr>

<?php 

$con=mysql_query("SELECT * FROM customer_contact WHERE customer_id='$usertypeid'");

$ro=mysql_fetch_array($con);
//extract($ro);
$name=$ro['customer_name'];
$mob=$ro['mobile'];
$add=$ro['address'];

?>
<tr>
	<td class="open" style="text-align:left;">Customer Name</td>
    <td class="open_data"><?php echo $name; ?></td>
</tr>

<tr>
	<td class="open" style="text-align:left;">Mobile</td>
    <td class="open_data"><?php echo $mob; ?></td>
</tr>

<tr>
	<td class="open" style="text-align:left;">Address</td>
    <td class="open_data"><?php echo $add; ?></td>
</tr>

<?php 

}
?>
	</table>


	</center>
	
	
	
		<?php require("includes/footer.php"); ?>
	</BODY>
</HTML>
